package com.qf.bigdata.controller;

import com.qf.bigdata.bean.UserEmbeddingResult;
import com.qf.bigdata.service.UserEmbeddingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/api/v1/user/embedding/")
public class UserEmbeddingCtl {

    @Autowired
    @Qualifier("userEmbeddingService")
    private  UserEmbeddingService userEmbeddingService;

    //相似用户搜索
    @RequestMapping("search/{uid}/{topk}")
    @ResponseBody
    public UserEmbeddingResult searchSimUser(@PathVariable Long uid, @PathVariable int topk){

        return userEmbeddingService.searchSimUserById(uid,topk);
    }
}
